This invention relates to processing pieces of artwork in a computer-graphics illustration.
Many items in everyday life exhibit some degree of transparency. For example, a car windshield is almost completely transparent. The tinted glass of a bottle is less transparent than a car windshield; however, a viewer can still make out objects behind the bottle.
Simulating transparency in a computer-generated images can consume large amounts of computer memory due to the amount of data needed to describe the image. For example, an image printed by a typical computer printer is made up of millions of colored dots roughly 0.005 inches in size. For each dot, a computer must determine a color based on the different transparent graphics overlapping the area covered by the dot. The process of determining these colors is known as xe2x80x9ccompositing.xe2x80x9d
In general, in one aspect, a method of processing a computer graphics illustration having overlapping pieces of artwork includes flattening the artwork into non-overlapping regions, storing information describing how the appearances of artwork can be combined to determine an appearance for the non-overlapping regions, determining an appearance for the non-overlapping regions based on the stored information, and outputting the determined appearance.
Embodiments may include one or more of the following. Outputting may include printing. Flattening the artwork into non-overlapping regions may include producing a planar map. The information describing how to combine appearances may include information describing how the appearances of two or more other non-overlapping regions can be combined to determine an appearance.
The method may further include discarding (e.g., deallocating from memory) the determined appearance of a non-overlapping region before determining an appearance of a different non-overlapping region. The method may further include not discarding selected regions.
Storing information may include constructing a directed graph that includes one or more nodes representing the appearance of one of the non-overlapping regions. Each node in the graph may be the root of a tree. Storing information may include constructing an artwork tree that stores transparency values for pieces of artwork. The artwork tree may store transparency values for groups of pieces of artwork.
Flattening artwork may include determining whether to include a piece of artwork or a portion of a piece of artwork in the flattening. Such determining may include determining whether a piece of artwork covers an area of the illustration also covered by one or more pieces of artwork having a degree of transparency. This determining may include mapping areas of the illustration covered by pieces of artwork having a degree of transparency and determining whether an opaque piece of artwork overlaps at least a portion of the mapped areas. Such mapping may include producing a map on an off-screen raster, for example, by using a rasterization engine to mark areas of the off-screen raster. The determining whether to include a piece of artwork in the flattening may include determining whether to include an opaque piece of artwork entirely within the mapped area. The determining may include a portion of an opaque piece of artwork within the mapped area. The outputting may include outputting an opaque piece of artwork outside the mapped area.
The determining whether to include a piece of artwork in the flattening may include mapping one or more complex regions of the illustration and determining whether a piece of artwork overlaps the mapped complex region(s). Mapping complex regions may include mapping areas having a number of paths of pieces of artwork that exceeds a threshold. Mapping a complex region may include stroking the paths of the pieces of artwork on an off-screen raster. The method may further include processing a piece of artwork based on its degree of overlap with a complex region. The method may further include rasterizing the complex region and outputting the rasterized area.
In general, in another aspect, the invention features a method of processing a computer graphics illustration having overlapping artwork objects. The method includes flattening the illustration artwork objects into non-overlapping regions of a planar map, and constructing a directed graph that includes a node for regions of the planar map. For at least some of the regions of the planar map, the method further includes determining a region appearance, outputting the determined appearance for the region, and discarding the stored appearance before determining the appearance of a different non-overlapping region.
In general, in another aspect, the invention features a computer program product, disposed on a computer readable medium, for processing a computer graphics illustration having overlapping pieces of artwork, each piece of artwork having an appearance. The computer program includes instructions for causing a processor to flatten at least some of the illustration artwork into non-overlapping regions, store information describing how the appearances of one or more pieces of artwork can be combined to determine an appearance for a given one of the non-overlapping regions, determine an appearance for at least one of the non-overlapping regions based on the stored information, and output the determined appearance.